﻿<!DOCTYPE html>
<html class="x-admin-sm">

<head>
    <meta charset="UTF-8">

    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
        content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />



    <link rel="stylesheet" href="../content/css/font.css">
    <link rel="stylesheet" href="../content/css/xadmin.css">
    <link rel="stylesheet" href="../content/plugin/bootstrap/css/bootstrap.min.css">
    <link rel='stylesheet' href='../content/plugin/bootstrap/css/style.css' />

    <script src="../content/js/jquery-1.10.2.min.js"></script>

    <script type="text/javascript" src="../content/js/xadmin.js"></script>
    <script type="text/javascript" src="../content/js/cookie.js"></script>
    <script src="../content/lib/layui/layui.js" charset="utf-8"></script>
    <link rel="stylesheet" href="../content/plugin/FileUpload/css/jquery.fileupload.css" />




</head>

<body>
    <div id="app">
        <div class="x-nav">

            <span class="nav-header">
                <a href="">首页</a>>
                <a href="">提现记录</a>

            </span>

        </div>
        <div class="x-body">


            <div class="layui-row">


                日期筛选：

                <div class="layui-input-inline">
                    <input type="text" class="layui-input" id="mydate" placeholder=" - ">


                </div>
                <button class="layui-btn" v-on:click="getdata"><i class="layui-icon">&#xe615;</i></button>


            </div>
            <hr />
            <div class="table-responsive">
                <table class="table table-bordered table-hover">

                    <thead>
                        <tr>

                            <th>
                                店铺</th>
                            <th>提现金额</th>
                            <th> 时间</th>
                            <th> 状态</th>
                            <th> 审核时间</th>
                            <th> 操作</th>

                        </tr>
                    </thead>
                    <tbody>
                        <tr v-for="uitem in arrayData">


                            <td>{{uitem.sitename}}</td>
                            <td>{{uitem.money}}</td>
                            <td>{{uitem.createtime}}</td>
                            <td>
                                <span v-if="uitem.state==1">已审核</span>
                                <span v-else>未审核</span>
                            </td>
                            <td>{{uitem.shenhetime}}</td>
                            <td>
                                <a title="编辑" v-if="uitem.state!=1" v-on:click="vupdate(uitem)" href="javascript:;">
                                    审核
                                </a>
                            </td>

                        </tr>
                    </tbody>
                </table>
            </div>
            <div class="page">
                <div>
                    <vue-nav :cur="search.page" :all="all" :allcount="allcount" :callback="callback"></vue-nav>
                </div>
            </div>

        </div>






    </div>
    <link href="../content/plugin/sweetalert/sweetalert.css" rel="stylesheet">
    <script src="../content/plugin/sweetalert/sweetalert.min.js"></script>
    <script src="../content/plugin/bootstrap/js/bootstrap.min.js"></script>
    <script src="../content/js/vue2.js"></script>
    <script src="../content/js/vue-nav.js"></script>
    <script src="../content/js/config.js"></script>


    <script>

        layui.use('laydate', function () {
            var laydate = layui.laydate;
            timeScope = laydate.render({
                elem: '#mydate'
                , range: true
                , ready: function (date) {
                    console.log("1", date); //得到初始的日期时间对象：{year: 2017, month: 8, date: 18, hours: 0, minutes: 0, seconds: 0}
                }
            });

        });

        Array.prototype.remove = function (val) {
            var index = this.indexOf(val);
            if (index > -1) {
                this.splice(index, 1);
            }
        };
        var vm = new Vue({
            el: "#app",
            data: {
                all: 0,
                search: {
                    page: 1,
                    size: 10
                },
                arrayData: [],
                allcount: 0,
                menulist: [],
                addobj: {
                    parentid: 0
                },
                editobj: {},
                datalist: [],
                statelist: [{ "id": 1, "name": "是" }, { "id": 0, "name": "否" }],
                typelist: [{ "id": "1", "name": "C端" }, { "id": "2", "name": "B端" }, { "id": "1,2", "name": "BC端" }],
                addobj: {},
                editobj: {},
                imgurl: "",
                qr: ""
            },
            components: {
                'vue-nav': Vnav
            },
            methods: {
                searchdata: function () {
                    this.search.page = 1;
                    this.getdata();
                },

                delcode: function (uitem) {
                    var datalist = this.datalist;
                    datalist.remove(uitem);
                    this.datalist = datalist;
                },
                getdata: function (_keycontent) {  //查询数据

                    this.search.stime = $("#mydate").val().split(" - ")[0];
                    this.search.etime = $("#mydate").val().split(" - ")[1];


                    var self = this;
                    $.post(apiurl + "/admin/dian/tixian/list", this.search, function (_result) {
                        console.log(_result);
                        self.arrayData = _result.data;
                        self.all = _result.allcount;
                        self.allcount = _result.count;
                    });

                },
                callback: function (data) {
                    var self = this;
                    this.search.page = data;
                    this.search.stime = $("#mydate").val().split(" - ")[0];
                    this.search.etime = $("#mydate").val().split(" - ")[1];

                    $.post(apiurl + "/admin/dian/tixian/list", this.search, function (_result) {
                        self.arrayData = _result.data;
                        self.all = _result.allcount;
                        self.allcount = _result.count;
                    });
                },
                vupdate: function (uitem) {

                    var obj = Object.assign({}, uitem);
                    var self = this;
                    swal({
                        title: "确定要审核吗?",
                        text: "",
                        type: "warning",
                        showCancelButton: true,
                        confirmButtonColor: "#DD6B55",
                        confirmButtonText: "是",
                        cancelButtonText: '否',
                        closeOnConfirm: false
                    }, function () {

                        $.ajax({
                            url: apiurl + '/admin/dian/tixian/sh',
                            type: 'POST',
                            data: obj,
                            success: function (result) {
                                if (result.status == 200) {
                                    swal("系统提示", "操作成功", "success");
                                    self.getdata("");
                                } else {
                                    swal("系统提示", "系统异常", "success");
                                }
                            }
                        });

                    });

                },

            },
            created: function () {  //初始化事件里边去调用查询方法
                this.search.wxapp_id = GetRequest("wxapp_id");
                this.getdata("");



            }
        });


    </script>
</body>

</html>